package com.wyz.saas.module.chat

import com.wyz.saas.common.base.AbstractApiApplication
import com.wyz.saas.module.chat.bean.repository.UserRepository
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.SupervisorJob

class ChatModuleApplication(private val application: AbstractApiApplication) {

    companion object {
        lateinit var INSTANCE: ChatModuleApplication
    }

    init {
        INSTANCE = this
    }

    val scope = CoroutineScope(SupervisorJob())
    val database by lazy { ChatDatabaseWapper.getDatabase(application) }
    val userRepository by lazy { UserRepository(database.userDao()) }
}